/* 左侧搜索控制面板 */
.search-control-panel {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

/* 横向导航栏 */
.search-panel-tabs {
  display: flex;
  background: #f8f9fa;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #e9ecef;
}

.search-tab-button {
  flex: 1;
  padding: 15px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px 10px 0 0;
}

.search-tab-button:hover {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}

.search-tab-button.active {
  background: white;
  color: #007bff;
  border-bottom: 2px solid #007bff;
}

/* 设置面板 */
.search-settings-panel {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.search-setting-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9ecef;
}

.search-setting-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.search-setting-group h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 数据模式选择器 */
.search-data-mode-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.search-data-mode-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.search-data-mode-selector input[type="radio"] {
  margin: 0;
}

/* 数据大小输入 */
.search-data-size-input {
  margin-bottom: 15px;
}

.search-data-size-input label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.search-data-size-input input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-data-size-input input[type="number"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 生成按钮 */
.search-generate-btn {
  width: 100%;
  padding: 10px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.search-generate-btn:hover {
  background: #218838;
}

/* 自定义数据输入 */
.search-custom-data-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-custom-data-input label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.search-custom-data-input textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
}

.search-custom-data-input textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-error-message {
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
}

/* 当前数据显示 */
.search-current-data {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
}

.search-data-display-text {
  margin-top: 5px;
  font-family: 'Courier New', monospace;
  color: #666;
}

/* 目标值输入 */
.search-target-input {
  margin-bottom: 15px;
}

.search-target-input label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.search-target-input input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-target-input input[type="number"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 速度控制 */
.search-speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-speed-control label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.search-speed-control input[type="range"] {
  flex: 1;
  margin: 0 10px;
}

.search-speed-control span {
  font-size: 12px;
  color: #666;
  min-width: 60px;
}

/* 控制按钮 */
.search-control-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.search-control-btn {
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.search-control-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-control-btn.search-start {
  background: #28a745;
  color: white;
}

.search-control-btn.search-start:hover:not(:disabled) {
  background: #218838;
}

.search-control-btn.search-step {
  background: #17a2b8;
  color: white;
}

.search-control-btn.search-step:hover:not(:disabled) {
  background: #138496;
}

.search-control-btn.search-pause {
  background: #ffc107;
  color: #212529;
}

.search-control-btn.search-pause:hover:not(:disabled) {
  background: #e0a800;
}

.search-control-btn.search-stop {
  background: #dc3545;
  color: white;
}

.search-control-btn.search-stop:hover:not(:disabled) {
  background: #c82333;
}

/* 状态信息 */
.search-status-info {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  border: 1px solid #e9ecef;
}

.search-status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}

.search-status-item:last-child {
  margin-bottom: 0;
}

.search-label {
  color: #666;
  font-weight: 500;
}

.search-value {
  color: #333;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.search-value.search-success {
  color: #28a745;
}

/* 聊天面板 */
.search-chat-panel {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* 快速问题 */
.search-quick-questions {
  margin-bottom: 20px;
}

.search-quick-questions h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-question-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-question-btn {
  padding: 10px 15px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: all 0.3s ease;
  color: #495057;
}

.search-question-btn:hover {
  background: #e9ecef;
  border-color: #007bff;
  color: #007bff;
}

/* 聊天区域 */
.search-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.search-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
  min-height: 200px;
  max-height: 400px;
}

/* 欢迎消息 */
.search-welcome-message {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.search-ai-avatar {
  font-size: 24px;
  flex-shrink: 0;
}

.search-message-content {
  flex: 1;
}

.search-message-content p {
  margin: 0 0 8px 0;
  line-height: 1.5;
  color: #495057;
}

/* 消息样式 */
.search-message {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.search-message.user {
  flex-direction: row-reverse;
}

.search-message-avatar {
  font-size: 20px;
  flex-shrink: 0;
}

.search-message.user .search-message-content {
  background: #007bff;
  color: white;
  padding: 10px 15px;
  border-radius: 15px 15px 5px 15px;
  max-width: 80%;
}

.search-message.ai .search-message-content {
  background: white;
  border: 1px solid #e9ecef;
  padding: 10px 15px;
  border-radius: 15px 15px 15px 5px;
  max-width: 80%;
}

.search-message-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 5px;
}

.search-message.ai .search-message-time {
  color: #6c757d;
}

/* 打字指示器 */
.search-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 0;
}

.search-typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6c757d;
  animation: searchTyping 1.4s infinite ease-in-out;
}

.search-typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.search-typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes searchTyping {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* 输入区域 */
.search-chat-input-area {
  flex-shrink: 0;
}

.search-input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.search-input-container input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input-container input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-send-btn {
  padding: 10px 15px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s ease;
}

.search-send-btn:hover:not(:disabled) {
  background: #0056b3;
}

.search-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 行内代码样式 */
.search-inline-code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #e83e8c;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-control-panel {
    width: 100% !important;
  }

  .search-panel-tabs {
    border-radius: 0;
  }

  .search-tab-button {
    padding: 12px 15px;
    font-size: 13px;
    border-radius: 0;
  }

  .search-settings-panel,
  .search-chat-panel {
    padding: 15px;
  }

  .search-control-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .search-data-mode-selector {
    flex-direction: column;
    gap: 10px;
  }

  .search-speed-control {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-speed-control input[type="range"] {
    margin: 0;
  }

  .search-chat-messages {
    min-height: 150px;
    max-height: 250px;
  }

  .search-message.user .search-message-content,
  .search-message.ai .search-message-content {
    max-width: 90%;
  }
}
